package csdn;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * 项目名称：wangxu
 * 类 名 称：日志上报
 * 描 述：https://dream.blog.csdn.net/article/details/129652513
 * 创建时间：2023/4/9 8:25 下午
 * 创 建 人：wang-xu
 */
public class RealTopic20 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        try {
            String s = in.nextLine();
            // 数据校验
            if (s.isEmpty()){
                System.out.println("input error");
            }
            String[] str = s.split(" ");
            if (str.length == 0){
                System.out.println("input error");
            }
            int[] nums = new int[str.length];
            for (int i = 0; i < str.length; i++) {
                nums[i] = Integer.parseInt(str[i]);
            }
            System.out.println(getScores(nums));
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public static int getScores(int[] nums){
        // 定义当前分数和累计分数
        int sum = 0;
        int myScores = 0;
        for (int i = 0; i < nums.length; i++) {
            sum += nums[i];
            myScores = sum + nums[i+1];
            if (myScores <= 100){
                myScores -= nums[i];
                return myScores;
            }
            if (myScores > 100){
                sum = 100 - nums[i];
                myScores = sum;
                return myScores;
            }
        }
        return myScores;
    }
}
